package edu.tyut.game.logic.network

import edu.tyut.game.logic.model.Comment
import edu.tyut.game.logic.model.FriendCircle
import edu.tyut.game.logic.model.WebResult
import okhttp3.MultipartBody
import retrofit2.Call
import retrofit2.http.Body
import retrofit2.http.DELETE
import retrofit2.http.GET
import retrofit2.http.Multipart
import retrofit2.http.POST
import retrofit2.http.Part
import retrofit2.http.Path

interface FriendCircleService {

    // 发布朋友圈
    @Multipart
    @POST("/circle/postFriendCircle")
    fun postFriendCircle(@Part files: List<MultipartBody.Part>): Call<WebResult<Boolean>>

    // 删除朋友圈
    @DELETE("/circle/deleteFriendCircle/{fcId}")
    fun deleteFriendCircle(@Path("fcId") fcId: Int): Call<WebResult<Boolean>>

    // 修改朋友圈
    @Multipart
    @POST("/circle/updateFriendCircle")
    fun updateFriendCircle(@Part parts: List<MultipartBody.Part>): Call<WebResult<Boolean>>

    // 查询朋友圈
    @GET("/circle/queryFriendCircle/{order}")
    fun queryFriendCircle(@Path("order") order: String): Call<WebResult<List<FriendCircle>>>

    // 朋友圈 点赞 + 1
    @GET("/circle/addFriendCircleLike/{fcId}")
    fun addFriendCircleLike(@Path("fcId") fcId: Int): Call<WebResult<Boolean>>

    // 朋友圈 取消点赞 - 1
    @GET("/circle/subFriendCircleLike/{fcId}")
    fun subFriendCircleLike(@Path("fcId") fcId: Int): Call<WebResult<Boolean>>

    // 发表评论
    @POST("/circle/postComment")
    fun postComment(@Body comment: Comment): Call<WebResult<Boolean>>

    // 删除评论
    @GET("/circle/deleteComment/{id}")
    fun deleteComment(@Path("id") id: Int): Call<WebResult<Boolean>>

    // 查询评论
    @GET("/circle/queryComment/{fcId}")
    fun queryComment(@Path("fcId") fcId: Int): Call<WebResult<List<Comment>>>

    // 评论点赞 + 1
    @GET("/circle/addCommentLike/{commentId}")
    fun addCommentLike(@Path("commentId") commentId: Int): Call<WebResult<Boolean>>

    // 评论取消点赞 - 1
    @GET("/circle/subCommentLike/{commentId}")
    fun subCommentLike(@Path("commentId") commentId: Int): Call<WebResult<Boolean>>

}